//只读属性,在初始化完毕之后是无法重新赋值的
interface Person {
    readonly name: string,
    readonly friend?: {
        name: string,
        age?: number,
        girlFriend?: {
            name: string
        }
    }
}

let obj: Person = {
    name: "哈哈",
    friend: {
        name: "xixi"
    }
}
//Cannot assign to 'name' because it is a read-only property
// obj.name = "xxx"
// obj.friend = {}
// obj.friend.name = "xxx"
console.log(obj.name)
console.log(obj.friend?.name)
console.log(obj.friend?.girlFriend?.name)
